package com.hwadee.backend.entity;

import lombok.Getter;
import lombok.Setter;

@Getter
@Setter
public class Result {
    // Getters and Setters
    private int code;
    private String message;
    private boolean success;
    private Object data;

    public Result(int code, String message, boolean success, Object data) {
        this.code = code;
        this.message = message;
        this.success = success;
        this.data = data;
    }

    public static Result success(Object data) {
        return new Result(200, "success", true, data);
    }

    public static Result success(String message, Object data) {
        return new Result(200, message, true, data);
    }

    public static Result error(String message) {
        return new Result(400, message, false, null);
    }

}